package com.tbit.uqbike.enums;

/**
 * @author chenmengran
 * @Description: 会员类型
 * @date 2019\7\12 001211:54
 */
public enum MemberType {

    MEMBER_TYPE_DAY("0", "按天计费"),
    MEMBER_TYPE_WEEK("1", "按周计费"),
    MEMBER_TYPE_MONTH("2", "按月计费"),
    MEMBER_TYPE_SERSON("3", "按季计费"),
    MEMBER_TYPE_BYEAR("4", "按半年计费"),
    MEMBER_TYPE_YEAR("5", "按年计费"),
    ;
    //开关类型
    private String type;
    //描述
    private String desc;

    private MemberType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    /**
     * 参数验证
     *
     * @param type
     * @return
     */
    public static Boolean Check(String type) {
        Boolean has_task = false;
        for (MemberType memberType : MemberType.values()) {
            if (memberType.getType().equals(type)) {
                has_task = true;
                break;
            }
        }
        return has_task;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
